package online.inote.naruto.api.access.admin.common.props;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @description Naruto Admin Web配置属性
 * @author XQF.Sui
 * @date 2021/07/31 11:44
 */
@Data
@Component
@ConfigurationProperties(prefix = "naruto.security.api.access.admin")
public class ApiAdminProperties {

  private Api api = new Api();
  private Cache cache = new Cache();
  private Database database = new Database();
  private Administrator administrator = new Administrator();

  @Data
  public static class Api {
    private String contextPath = "/naruto";
  }

  @Data
  public static class Database {
    /** 是否启用数据库持久化 */
    private Boolean enable = true;
  }

  @Data
  public static class Cache {
    /** 是否启用数据库持久化 */
    private String cacheKeyPrefix = "NARUTO:API_ACCESS:MANAGEMENT_BACKGROUND:ACCOUNT:";
  }

  /**
   * @description Admin管理员登录账户信息
   * @author XQF.Sui
   * @date 2021/8/3 10:43
   */
  @Data
  public static class Administrator {
    private String username;
    private String password;
  }
}
